package com.api.wall.getgroupevents;

import java.util.List;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.api.test.AbstractApiTest;
import com.zyncro.api.IWallApiService;
import com.zyncro.api.exceptions.ZyncroApiException;
import com.zyncro.api.model.EventApiType;
import com.zyncro.api.model.EventViewApiType;

@ContextConfiguration(locations = { "classpath:/wall/wall-static.xml" })
public class GetGroupEventsOpenExternal extends AbstractApiTest {

	@Value("#{group_toGetOpen[externalUser].appId}")
	private String userUrn;

	@Value("#{group_toGetOpen[externalUser].password}")
	private String userPassword;

	@Value("#{group_toGetOpen.urn}")
	private String groupUrn;

	@BeforeClass
	protected void setParameters() throws Exception {

		getApi().login(userUrn, userPassword);
	}

	@Test(expectedExceptions = ZyncroApiException.class)
	public void testGroupFeedsAll() throws ZyncroApiException {

		String date = null;
		int itemsCount = 0;
		List<EventApiType> eventTypes = null;
		boolean includeHtml = false;
		EventViewApiType viewType = null;
		List<String> users = null;
		boolean includeProperties = false;

		getApi().getService(IWallApiService.class).getGroupEvents(groupUrn, date, itemsCount, eventTypes, includeHtml, includeProperties,
				viewType, users);
	}
}
